package cn.wgx.modules.sys.util;

import cn.wgx.commons.util.SpringContextHolder;
import cn.wgx.modules.sys.entity.SysUserJourney;
import cn.wgx.modules.sys.services.SysUserJourneyService;

/**
 * 个人历程工具类
 *
 *
 *
 */

public class UserJourneyUtil {


    private static SysUserJourneyService sysUserJourneyService = SpringContextHolder.getBean("sysUserJourneyService");


    public static void addJourney(String title, String content, Integer user_id){
        addJourney(title, content, user_id, 1,1);
    }


    public static void addJourney(String title, String content, Integer user_id, Integer level, Integer type){
        SysUserJourney sysUserJourney = new SysUserJourney();
        sysUserJourney.setTitle(title);
        sysUserJourney.setContent(content);
        sysUserJourney.setCreateUserId(user_id);
        sysUserJourney.setLevel(level);
        sysUserJourney.setType(type);
        new Thread(()->sysUserJourneyService.insertOne(sysUserJourney)).start();
    }

}
